<template>
<view>
<template name="alert">
    <view class="wx_dialog_container" :hidden="!isShow">
        <view class="wx-alert-mask"></view>
        <view class="wx-alert-dialog">
            <view class="wx-alert-dialog-title">尊敬的用户</view>
            <view class="wx-alert-dialog-content">尚未获取到您的用户信息，较多功能无法体验，请允许获取用户信息</view>
            <view class="wx-alert-dialog-footer">
                <button @tap="hideDialog" class="wx-alert-dialog-btn">拒绝</button>
                <button @getuserinfo="updateUserInfo" class="wx-alert-dialog-btn" open-type="getUserInfo">允许</button>
            </view>
        </view>
    </view>
</template>
</view>
</template>

<script>
var app = getApp();

export default {
  data() {
    return {
      isShow: !1
    };
  },

  components: {},
  props: {},
  onLoad: function (o) {
    this.show(), wx.login({
      success: function (o) {}
    });
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {},
  methods: {
    show: function () {
      this.setData({
        isShow: !0
      });
    },
    hideDialog: function () {
      this.setData({
        isShow: !this.isShow
      });
    },
    updateUserInfo: function (o) {
      getApp().util.getUserInfo(function (o) {
        console.log(wx.getStorageSync("userInfo")), console.log(o.memberInfo.uid);
      }, o.detail);
    }
  }
};
</script>
<style>
@import "./index.css";
</style>